<?php
/**
 * 认证模块 控制器
 *
 * @author    wangmx <wangmx@yunys.com.cn>
 * @copyright 2016 QuanZhouYunYiShang Inc.
 */
namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Response;
use App\Services\UserService\authenticationService;

class AuthenticationController extends BaseController
{
    protected $authen;

    public function __construct(authenticationService $authen)
    {
        $this->authen = $authen;
    }


    /**
     * @return authenticationService
     */
    public function getAuthen()
    {
        return $this->authen;
    }
    
    /**
     * 上传图片返回URL
     */
    public function saveImg(Request $request){
        $url = $this->getAuthen()->saveImg($request);
        return Response::json($url);
    }

    /**
     * 设计师认证信息录入
     */
    public function DesignerAuthenticationRecord(Request $request){
        $result = $this->getAuthen()->DesignerAuthenticationRecord($request);
        return Response::json($result);
    }

    /**
     * 品牌认证信息录入
     */
    public function BrandAuthenticationRecord(Request $request){
        $result = $this->getAuthen()->BrandAuthenticationRecord($request);
        return Response::json($result);
    }

    /**
     * 设计师认证修改
     */
    public function DesignerAuthenticationEdit(Request $request){
        $result = $this->getAuthen()->DesignerAuthenticationEdit($request);
        return Response::json($result);
    }

    /**
     * 品牌认证修改
     */
    public function BrandAuthenticationEdit(Request $request){
        $result = $this->getAuthen()->BrandAuthenticationEdit($request);
        return Response::json($result);
    }
    

}
